package com.itlong.cloud.operate.resource;

import com.itlong.cloud.POJO.DTO.operate.OperateUserRecordPageDTO;
import com.itlong.cloud.POJO.VO.operate.OperateDeviceOpenTypeVO;
import com.itlong.cloud.POJO.VO.operate.OperateUserRecordVO;
import com.itlong.cloud.operate.service.IOperateUserRecordService;
import com.itlong.cloud.user.operate.IOperateUserRecordServiceClient;
import com.itlong.cloud.utils.page.Page;
import org.slf4j.Logger;import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <desc>
 * 运营-APP用户-业主通行记录业务处理暴露接口实现类。
 * <desc/>
 *
 * @createDate 2017/9/26.
 */
@RestController
public class OperateUserRecordServiceResource implements IOperateUserRecordServiceClient {


    private static final Logger LOG = LoggerFactory.getLogger(OperateUserManageServiceResource.class);

    @Autowired
    IOperateUserRecordService iOperateUserRecordService;


     /**
      * <desc>
      *      根据查询条件获取业主通行记录列表。
      * <desc/>
      *
      * @param  pageDTO
      * @return
      * @author shengen.T
      * @createDate 2017/9/26
      */
    @Override
    @RequestMapping(path = "/appUser/record/getUserRecordPage")
    public Page<OperateUserRecordVO> getUserRecordPage(@RequestBody OperateUserRecordPageDTO pageDTO) throws Exception
    {
        return iOperateUserRecordService.getPage(pageDTO);
    }

    /**
     * <desc>
     *     获取通行方式列表。
     * <desc/>
     *
     * @param recType
     * @return 返回通行方式列表 （通行方式ID 和 通行方式名称）
     * @author shengen.T
     * @createDate 2017/10/31
     */
    @Override
    @RequestMapping(path = "/appUser/record/getOpenTypeList")
    public List<OperateDeviceOpenTypeVO> getOpenTypeList(@RequestParam("recType") Integer recType) throws Exception{
        return iOperateUserRecordService.getOpenTypeList(recType);
    }

}
